<?php
/**
* pdflib wrapper
* Copyright (C) 2009 Noor Griffin
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
* 
* Contact: noorg1977@gmail.com
*/
require_once './classes/pdfwrapper.class.php';
class testpdf
{
	/**
	 * Initializes the test PDF using test configurations and data
	 * Finishes by creating a PDF from the data passed
	 * 
	 * @return void
	 */
	public function __construct()
	{
		// Initialize the table object
		$configs = array(
			'page_width' => 595,
			'page_height' => 842,
			'lowerleft_x' => 50,
			'lowerleft_y' => 50,
			'upperright_x' => 550,
			'upperright_y' => 800,
			'page_orientation' => 'topdown',
			'font_size' => 8,
			'normal_font' => 'Arial',
			'bold_font' => 'Arial_Bold',
			'line_spacing' => 11,
			'search_path' => './fonts/',
			'author' => 'Nettekk PDF Developer',
			'title' => 'Nettekk PDF',
			'td_align' => 'left',
			'td_margin' => 3
		);
		$pdf = new pdfwrapper($configs, 'test.pdf');
		
		// Create a test data array
		$data_items = array(
			array(
				'Contact' => 'Bobbie Lean',
				'Phone' => '888-888-0000',
				'Amt Due' => 5512.55
			),
			array(
				'Contact' => 'James Anyh',
				'Phone' => '855-555-1212',
				'Amt Due' => 52.5
			),
			array(
				'Contact' => 'Amy Zant',
				'Phone' => '888-435-8899',
				'Amt Due' => 460.2
			),
			array(
				'Contact' => 'Jamie Fonds',
				'Phone' => '755-998-2445',
				'Amt Due' => 95874.6
			),
			array(
				'Contact' => 'Tony Moens',
				'Phone' => '877-585-9922',
				'Amt Due' => 47
			),
			array(
				'Contact' => 'Fred King',
				'Phone' => '599-454-7878',
				'Amt Due' => 126
			)
		);

		// Create a data table for the data to be displayed
		$pdf->createDataTable($pdf, $data_items);
	}
}
$pdf = new testpdf();
?>
